package homeWork;

public class homeWork3 {
    public static void main(String[] args) {
        System.out.println("三位数的水仙花数有：");
        for (int i = 100; i < 1000; i++) {
            if (shuixianhua(i)){
                System.out.println(i);
            }
        }
    }
    public static boolean shuixianhua(int n){
        int number,ge,result=0;
        number = n;
        while(number!=0){
            ge = number%10;
            result += Math.pow(ge,3);
            number /= 10;
        }
        return result == n;
    }
}
